/*
 * @Description:
 * @Date: 2022-02-17 15:40:47
 * @LastEditTime: 2022-02-17 18:02:00
 * @FilePath: /vue3-element-plus/mock/input.ts
 * @Author: Devin
 */
import Mock from 'mockjs';
const Random = Mock.Random;
let input: Array<any> = [
  {
    url: '/input/list',
    type: 'get',
    response: (config: { query: any; }) => {
      
      let query = config.query;
      let data = Array.from({ length: 500 }, (_, idx) => ({
        id: Random.id(),
        name: Random.cname(),
      }));
      return {
        code: 0,
        data: data.filter((item) => {
          return item.name.indexOf(query.keyword) !== -1
        })
      };
    }
  }
];

export default input;
